// 弹窗复选
import React from 'react';
import { Modal } from 'antd';
import styles from './index.less';
import planIcon from '@/assets/img/plan_icon.png';

const TJModel = (props) => {
  const {
    width = 720,
    visible,
    title,
    titleIcon = planIcon,
    okText = '确定',
    cancelText = '取消',
    ...others
  } = props;

  return (
    <Modal
      width={width}
      className={styles.modal}
      centered={true}
      visible={visible}
      maskClosable={false}
      getContainer={false}
      destroyOnClose={true}
      title={
        <div key="title" className={styles.modal_title}>
          <div className={styles.title}>
            <img src={titleIcon} />
            <div className={styles.iconText}>{title}</div>
          </div>
        </div>
      }
      cancelText={cancelText}
      okText={okText}
      {...others}
    >
      {props.children}
    </Modal>
  );
};

export default TJModel;
